import React, { useEffect } from 'react'
import { show, hide } from '../redux/actionCreator';
import { connect } from 'react-redux';

function Detail(props) {
  let {hide, show, match} = props;
  useEffect(()=>{
    hide()
    return ()=>{
      show()
    }
  },[hide, show])
  return (
    <div>
        这里是电影{match.params.myid}
    </div>
  )
}

const changeDispatchToProps = {
  show,
  hide
}

export default connect(null, changeDispatchToProps)(Detail)